import request from '@/utils/request'

export default {
    //1、讲师列表(条件查询分页)
    //三个参数
    //teacherQuery条件对象，后端使用 RequestBody 获取数据
    //data表示把对象转成json进行传递到接口里面
    //讲师列表（条件查询分页）
    getTeacherListPage(current, limit, teacherQuery) {
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            data: teacherQuery
        })
    },
    //2、讲师删除
    deleteTeacherId(id) {
        return request({
            url: `/eduservice/teacher/${id}`,
            method: 'delete',
        })
    },
    //3、讲师添加
    addTeacher(teacher) {
        return request({
            url: `/eduservice/teacher/addTeacher`,
            method: 'post',
             //data表示把对象转成json进行传递到接口里面
            data: teacher
        })
    },
    //4、根据Id查找讲师
    getTeacherInfo(id) {
        return request({
            url: `/eduservice/teacher/${id}`,
            method: 'get'
        })
    },
    //5、修改讲师
    updateTeacher(teacher) {
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data:teacher
        })
    }


}

